package com.itany.shop.dao.impl;


import com.itany.shop.dao.UserDao;
import com.itany.shop.entity.User;
import com.itany.shop.factory.ObjectFactory;
import com.itany.shop.util.JDBCTemplate;

/**
 * @author 黄衡熙
 * @version 1.0
 */
public class UserDaoImpl implements UserDao {
    private JDBCTemplate jdbcTemplate = (JDBCTemplate) ObjectFactory.getObject("jdbc");
    @Override
    public void insertUser(User user) {
        String sql = new StringBuffer()
                .append(" insert into ")
                .append(" t_user(username,password,phone,address)")
                .append(" values(?,?,?,?)")
                .toString();
        jdbcTemplate.update(sql, user.getUsername(), user.getPassword(), user.getPhone(), user.getAddress());
    }


}
